{include file="Public/header"/}
<!--HEADER E-->
<div class="clearfix clearfix20"></div>

<div class="container">
    <div class="row">
       		 {include file="Public/readme"/}
        <div class="col-sm-9">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">设置提现密码</h3>
                </div>
                <div class="panel-body">
        {if condition="$user.paymentPassword==null"}
        <div class="col-md-9">
            <div class="tab-content row">
                <div class="col-md-4 text-center d-none d-sm-block">
                    <img src="/static/home/images/imgHead.jpg" />
                </div>

                <form id="setpwForm" method="post" class="form-horizontal col-md-8" action="/home/Setpassword/setPwd" novalidate="novalidate">

                    <div class="form-group row">
                        <label class="col-md-3 sm-text-right control-label" for="setpwUserName"><b class="text-danger">*</b>&nbsp;用户名：</label>
                        <div class="col-md-9 has-error has-feedback">
                            <input type="text" class="form-control" id="setpwUserName" name="setpwUserName"  placeholder="{:substr(Session('phonenumber'),0,3).'****'.substr(Session('phonenumber'),-4)}" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true" disabled>
                            <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                            <label id="setpwUserName-error" class="error" for="setpwUserName"></label>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-md-3 sm-text-right control-label" for="setpwUserName"><b class="text-danger">*</b>&nbsp;登录密码：</label>
                        <div class="col-md-9 has-error has-feedback">
                            <input type="password" class="form-control" id="setpwUserName" name="logpwd"  placeholder="请输入登录密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                            <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                            <label id="setpwUserName-error" class="error" for="setpwUserName"></label>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-md-3 control-label" for="setpwUserPassword"><b class="text-danger">*</b>&nbsp;设置提现密码：</label>
                        <div class="col-md-9 has-error has-feedback">
                            <input type="password" class="form-control" id="setpwUserPassword" name="setpwUserPassword" placeholder="请输入提现密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                            <span class="glyphicon glyphicon-remove form-control-feedback" id="pwd"></span>
                            <label id="setpwUserPassword-error" class="error" for="setpwUserPassword"></label>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-md-3 control-label" for="setpwUserConfirmPassword"><b class="text-danger">*</b>&nbsp;确认提现密码：</label>
                        <div class="col-md-9 has-error has-feedback">
                            <input type="password" class="form-control" id="setpwUserConfirmPassword"  name="setpwUserConfirmPassword" placeholder="请再次输入提现密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                            <span class="glyphicon glyphicon-remove form-control-feedback" id="pwds"></span>
                            <label id="setpwUserConfirmPassword-error" class="error" for="setpwUserConfirmPassword"></label>
                        </div>
                    </div>
                    <input type="hidden" name="codes" value="{:session("codes")}">
                    <div class="form-group row">
                        <div class="col">
                            <button type="submit" class="btn btn-success btn-block" name="signup1" value="设置提现密码">设置提现密码</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        {else \}
        <div class="col-md-9">
             <div id="myTabContentGrxx" class="tab-content">
                        <div role="tabpanel" class="tab-pane fade active in" id="tGrxx" aria-labelledby="tGrxx-tab">

                            <div class="col-md-8 col-xs-12 col-sm-6">
                                <h4>提现密码状态</h4>
                                <p><a href="#" class="btn btn-success" style="width:120px;">已设置</a>
                                    <a href="/home/Setpassword/indexs" class="btn btn-danger" style="width:120px;">重新设置</a></p>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        {/if}
                </div>
            </div>

        </div>
    </div>
</div>


{include file="Public/footer"/}
<script> $("#collapseOne").find(".list-group").find("li").eq(7).addClass("active");</script>
<script>

    flag=false;flags = false;flpwd=false;flpwds=false;


    $('#setpwUserPassword').focus(function(){
        $("#pwd").html('');
    }).blur(function(){
        var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？《》]");
        var pwd = $("#setpwUserPassword").val();
        if(!pwd){
            $("#pwd").html('密码不能为空').css('color','red');
            flags=false;
        }else{
            if(pattern.test(pwd)){
                $("#pwd").html('不能使用特殊字符').css('color','red');
                flags = false;
            }else{
                flags = true;
            }
        }

    });

    $("#setpwUserConfirmPassword").focus(function(){
        $("#pwds").html('');
    }).blur(function(){
        pwd = $("#setpwUserPassword").val();
        pwds = $("#setpwUserConfirmPassword").val();
        if(!pwds){
            $("#pwds").html('密码不能为空').css('color','red');
            flpwd=false;
        }else{
            if(pwd!=pwds){
                $("#pwds").html('两次密码不一致').css('color','red');
                flpwd=false;
            }else{
                flpwd=true;
            }
        }
    });

    $("form").submit(function(){
        if (!flags||!flpwd){
            return false;
        }else{
            return true;
        }
    });
</script>

<script>
    $("#signup1s").click(function(){
        if(confirm("确认重新设置提现密码")){
            $(".passwordSet").hide();
            $(".passwordReset").show();
        }

    })

</script>

